﻿using System.Web.Mvc;
using JoelAbrahamsson.BlogExtensions;

namespace JoelAbrahamsson.Web.ModelBinders
{
    public class BlogModelBinder : IModelBinder
    {
        ExtendedBlogHandlerFacade _blogHandlerFacade;

        public BlogModelBinder(ExtendedBlogHandlerFacade blogHandlerFacade)
        {
            _blogHandlerFacade = blogHandlerFacade; 
        }

        public object  BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            return _blogHandlerFacade.GetBlog(2);
        }
    }
}